<template>
	<view>
	<!--<u-navbar back-icon-color="#000000" :border-bottom="false" title-color="#000000" title="好友列表" :background="background"></u-navbar> -->
		<view class="top">
			<view class="con">
				<view class="item">
					<view class="item1">好友人数</view>
					<view class="item2 color1">{{info.children}}</view>
				</view>
				<view class="item">
					<view class="item1">累计获得<text style="font-size:24rpx;">(Ghy)</text></view>
					<view class="item2 color2">{{info.total_profit}}</view>
				</view>
				<view class="item">
					<view class="item1">预期获得<text style="font-size:24rpx;">(Ghy)</text></view>
					<view class="item2 color3">{{info.already_profit}}</view>
				</view>
			</view>
		</view>

		<view class="content">
			<view class="title">好友列表</view>
			<view v-if="info.list.length>0">
				<view class="list" v-for="(item,index) in info.list" :key="index">
					<view class="item1">
						<image :src="getHead(item.head_img)"></image>
						<image src="../static/telphone.png" @click="makePhoneCall(item.telphone)" class="icon"></image>
					</view>
					<view class="item2">
						<view class="name omit">
							{{ item.username }}
						</view>
						<view class="date" style="margin-top:10rpx;">
							注册:{{item.createtime}}
						</view>
					</view>
					<view class="item3">
						<view class="item3_item item3_item_bg1">
							<view class="item_b">
								<image src="../static/friends_tb1.png"></image>
							</view>
							<view class="item_a">
								好友总数
							</view>
							<view class="item_c item_c_color1">{{ item.children }}</view>
						</view>
						<view class="item3_item item3_item_bg2">
							<view class="item_b">
								<image src="../static/friends_tb3.png"></image>
							</view>
							<view class="item_a">
								累计获得(Ghy)
							</view>
							<view class="item_c item_c_color2">{{item.total_number}}</view>
						</view>
					</view>
				</view>
			</view>
			<view class="none" v-else>
				<view class="none-view">
					<image src="../../../static/image/none.png" class="none-image"></image>
					<view class="none-name">
						暂无相关数据~
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	var than;
	export default {
		data() {
			return {
				background: {
					'background': '#FAFAFA'
				},
				info: {
					list: []
				},
				page: 1
			}
		},
		onLoad(option) {
			than = this;
			than.getList()
		},onReachBottom() {
			than.page++;
			than.getList()
		},
		methods: {
			getList() {
				than.post("api/Goldbean/friendList", {
					page: than.page
				}, function(data) {
					than.info.already_profit=data.already_profit
					than.info.children=data.children
					than.info.total_profit=data.total_profit
					if (than.page == 1) {
						than.info.list = data.list;
					} else {
						than.info.list = than.info.list.concat(data.list)
					}
				})
			},
			makePhoneCall(telphone) {
				uni.makePhoneCall({
					phoneNumber: telphone
				});
			}
		}
	}
</script>

<style lang="less">
	page {
		background: #FAFAFA;
	}

	.none {
		margin: auto;
	}

	.top {
		// /* #ifdef APP-PLUS */
		// height: calc(400rpx + var(--status-bar-height));
		// padding-top: 180rpx;
		// /* #endif */
		// /* #ifdef H5 */
		// padding-top: 120rpx;
		// height: 400rpx;
		// /* #endif */
		// background: #EFE1CC;
		// position: absolute;
		// left: 0;
		// right: 0;
		// top: 0;
		// z-index: 1;
        padding:0rpx 40rpx;
		margin-top:20rpx;
		.con {
			display: flex;
            background: #F3F9F9;
			border-radius:10rpx;
			padding:50rpx 20rpx;
			.item {
				flex: 1;
				text-align: center;
				// margin-top: 40rpx;
             
				.item1 {
					
					// font-weight: bold;	
					font-size: 32rpx;
					font-weight: 500;
					color: #41485D;
				}

				.item2 {
					// font-size: 64rpx;
					// font-weight: bold;
					// color: #1B1B1D;
					margin-top: 20rpx;
					font-size: 44rpx;
					font-weight: 400;
					
				}
				.color1{
					color: #F66337;
				}
				.color2{
					color: #205FFA;
				}
				.color3{
					color: #13AB7B;
				}
			}
		}
	}

	.content {
		// position: relative;

		// z-index: 2;
		// // border-radius: 20rpx 20rpx 0rpx 0rpx;
		// /* #ifdef APP-PLUS */
		// padding-top: calc(320rpx + var(--status-bar-height));
		// // margin-top: -100rpx;
		// /* #endif */
		// /* #ifdef H5 */
		// padding-top: 320rpx;
		// // margin-top: -40rpx;

		// /* #endif */
		.title {
			padding-left: 36rpx;
			padding-right: 36rpx;
			border-radius: 20rpx 20rpx 0rpx 0rpx;
			// background: #f4f4f4;
			line-height: 94rpx;
			height: 94rpx;
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #333333;
		}

		.list {
			margin-left: 36rpx;
			margin-right: 36rpx;
			display: flex;
			// height: 146rpx;
			padding: 20rpx 25rpx;
			background: white;
			align-items: center;
			border-radius: 20rpx;
			margin-bottom: 20rpx;

			.item1 {
				position: relative;
				line-height: 1;
				width: 98rpx;
				height: 98rpx;
            
				image {
					width: 100%;
					height: 100%;
					border-radius: 50%;
				}

				.icon {
					position: absolute;
					width: 52rpx;
					height: 52rpx;
					bottom: 0;
					right: 0;
				}
			}

			.item2 {
				// width: 90rpx;
				margin-left: 20rpx;
				font-size: 30rpx;
				font-weight: bold;
				color: #333333;
                 .name{
					 width: 90rpx;
				 }
				.date {
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #999999;
				}
			}

			.item3 {
				margin-left: auto;
               
				.item3_item {
					float: left;
					padding: 0 26rpx;
					margin-left: 10rpx;
					border-radius:10rpx;

					.item_a {
						text-align: center;
						margin-top: 10rpx;
						font-size: 20rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #666666;
					}

					.item_b {
						margin-top: 10rpx;
						text-align: center;

						image {
							width: 40rpx;
							height: 40rpx;
						}
					}
                    .item_c_color1{
						color: #FEC55D;
					}
					.item_c_color2{
						color: #205FFA;
					}
					.item_c {
						margin-top: 10rpx;
						text-align: center;
						font-size: 20rpx;
						font-weight: bold;
						
					}

				}
				.item3_item_bg1{
					background: #FDFBF3;
				}
				.item3_item_bg2{
					background: #F2F5FD;
					padding: 0 10rpx;
				}
			}
		}
	}
</style>
